#-*- coding:utf-8 -*-

def ex26(n=0):#利用递归方法求5!。
    result = 1
    if n==0:
        return result
    else:
        result = n*ex26(n-1)
        return result;

def ex27(s):#利用递归函数调用方式，将所输入的5个字符，以相反顺序打印出来
    if len(s)>0:
        print s[-1],
        return ex27(s[0:-1])
    else:
        return
def ex28(n=5,c=2):
    if n ==1:
        age= 10
    else:
        age =ex28(n-1) +c
    return age

def ex30():#一个5位数，判断它是不是回文数。即12321是回文数，个位与万位相同，十位与千位相同
    while True:
        a = raw_input('input num :')
        try:
            num = int(a)
            g = num%10
            w = num/10000
            s = num/10%10
            q = num%10000/1000
            print g ,w ,s ,q
            if g==w and s==q:
                return '%s 是回文'%num
            else:
                return '%s 不是回文' % num

        except Exception,e:
            print e
            print '输入的格式不对，重新输入:'
            continue



if __name__=='__main__':
    # print ex26(n=3)
    # ex27(raw_input('input str:'))
    # print ex28(n=5)
    print ex30()